import axios from 'axios'

//获取openid
export function OpenIdRecord(data) {
  const url = baseURL + 's=User/OpenIdRecord'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}

//微信分享
export function weChatShare(data) {
  const url = 'https://www.6vbuy.com/member/index.php?act=wx_share&op=getSignPackage&com=6vbuy'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}

//暂不注册，微信登录
export function TouristLogin(data) {
  const url = baseURL + 's=User/TouristLogin'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}

//分享统计
export function statisticsShare(data) {
  const url = 'https://www.6vbuy.com/member/index.php?act=wx_share&op=addWXShareInfo&com=6vbuy'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}

//获取头像信息
export function getHead(data) {
  const url = ' https://www.6vbuy.com/member/index.php?act=wx_login&op=getWXLoginInfo&com=6vbuy'
  return axios.post(url, data, {
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  }).then(res => {
    return res.data;
  })
}
